Welcome to an Overview of MongoDB. After watching this video, you will be able
to: Explain what MongoDB is
List the different components of MongoDB And describe why and where to use MongoDB
MongoDB is a document and a NoSQL database. Instead of storing data in tables of rows
or columns like SQL databases, each record in a MongoDB database is a document,
And you store the data in a non-relational way. Documents are associative arrays like JSON
objects or Python dictionaries. For example, a student document representing
a student’s first name, last name, email address, and ID. MongoDB documents of similar type are grouped
into a collection. Our campus management system stores all student
records or documents in the Students collection. And similarly, all staff documents are stored
in the Employees collection. So, what is a database? Following our previous example,
The campus management system stores all different types of data related to it in a MongoDB database
called Campus Management DB. Let’s dissect our document. In the document below, firstName, lastName,
email, and studentId are fields or properties, with values representing a student named John
Doe, And each field name is unique within that
document. MongoDB supports variety of data types, so
you have the full capability to use the correct data type to store your information in. For example,
Dates should be stored as ISODate or Unix style epoch dates, which will help you with
queries like “Give me all students born between 15th of January to 15th of February.” Numbers can be stored either as whole numbers
or decimals. Being a document database, MongoDB also allows
you to store sub-documents to group secondary information together. It also supports lists of values. Not just text, but even different kinds mixed
together. Working with MongoDB is easy because you can
focus on the data you are writing and how you are going to read it. Traditional relational databases required
you to create the schema first, then create table structures that will hold your data. So, if you decide to store an additional field,
you will then have to alter your tables. In MongoDB, you change as you go along. MongoDB also gives you the power to bring
in any structured or unstructured data. MongoDB also provides high availability by
keeping multiple copies of your data, which we will cover in later topics. You can design complex data structures easily
in MongoDB without worrying about the complexity of how it is stored and how it should be linked. For example, your Campus Management application
is also launched in the USA, where they do not store postcodes, but have zip codes. Scalability provided by MongoDB means as your
data needs grow, you can easily scale vertically, by introducing bigger, faster, better hardware,
or horizontally, by partitioning your data. All of that can be done whether you are running
a self-managed on-premises MongoDB, or the hybrid or cloud hosted and fully managed services
such as IBM Cloud Databases for MongoDB or MongoDB Atlas on AWS, Azure,
and Google Cloud. In this video, you learned that:
MongoDB is a document and a NoSQL database MongoDB supports various data types
Documents provide a flexible way of storing data
MongoDB documents of a similar type are grouped into collections
MongoDB models data as you read/write, brings structured or unstructured data, and provides
high availability MongoDB can be used for a variety of purposes
because of the flexibility of storing structured or unstructured data.